עיבוד שפות טבעיות מבוא ד"ר יואב גולדברג פרופ' עידו דגן )קרדיט לחלק מהשקפים: אורן גליקמן( המחלקה למדעי המחשב אוניברסיטת בר אילן 1
מבנה הקורס ודרישות 2 תרגילים 40% כ- 4, תכנות בזוגות שפת תכנות: ושימוש בתוכנות NLP Python מבחן 60% אתר הקורס: http://www.cs.biu.ac.il/~ אפשר הגשה הערה: החומר בספרים אינו מכסה חלקים ניכרים מהחומר ולכן נחוץ להגיע להרצאות.
מקורות Recommended readings along the course Speech and Language Processing, 2 nd edition By Daniel Jurafsky and James H. Martin http://www.cs.colorado.edu/~martin/slp/slp-ch1.pdf 3 3 rd edition draft: https://web.stanford.edu/~jurafsky/slp3/ Jacob Eisenstein online book https://github.com/jacobeisenstein/gt-nlpclass/blob/master/notes/eisenstein-nlp-notes.pdf Foundations of Statistical NLP Christopher D. Manning and Hinrich Schutze 1999, MIT Press. http://nlp.stanford.edu/fsnlp/promo/
מה זה בכלל עיבוד שפות טבעיות נקרא גם "בלשנות חישובית Natural Language Processing/ Computational Linguistics כל מה שקשור בהבנה, ניתוח, יצירה ועיבוד של שפות טבעיות )להבדיל משפות מחשב, למשל( שפה מהווה ייצוג של משמעות איננו מתיימרים להגיע להבנה "אמיתית" של משמעות, אלא לבצע פעולות מועילות למרות החוסר בהבנה, או להגיע למודלים מקורבים 4
דוגמאות לאפליקציות/יישומים תרגום ממוחשב חיפוש ואחזור מידע מענה לשאלות Answering Question שליפת מידע Extraction Information טיפול במונחים: שליפה, דמיון, סיווג שמות תמצות אוטומטי אפליקציות בתחום הדיבור: מערכות דיאלוג תיקון שגיאות כתיב ותחביר (eg. Microsoft Word) 5
6
7
Towards text understanding: Question Answering 8
9
Search may benefit understanding Query: AIDS treatment Irrelevant document: Hemophiliacs lack a protein, called factor VIII, that is essential for making blood clots. As a result, they frequently suffer internal bleeding and must receive infusions of clotting protein derived from human blood. During the early 1980s, these treatments were often tainted with the AIDS virus. In 1984, after that was discovered, manufacturers began heating factor VIII to kill the virus. The strategy greatly reduced the problem but was not foolproof. However, many experts believe that adding detergents and other refinements to the purification process has made natural factor VIII virtually free of AIDS. (AP890118-0146, TIPSTER Vol. 1) Many irrelevant documents mention AIDS and treatments for other diseases 10
Relevant Document Query: AIDS treatment Federal health officials are recommending aggressive use of a newly approved drug that protects people infected with the AIDS virus against a form of pneumonia that is the No.1 killer of AIDS victims. The Food and Drug Administration approved the drug, aerosol pentamidine, on Thursday. The announcement came as the Centers for Disease Control issued greatly expanded treatment guidelines recommending wider use of the drug in people infected with the AIDS virus but who may show no symptoms. (AP890616-0048, TIPSTER VOL. 1) Relevant documents may mention specific types of treatments for AIDS 11
Information Extraction (IE) Identify information of pre-determined structure Automatic filling of forms Example - extract product information: Company Product Type Product Name Hyundai Car Accent Hyundai Car Elantra Suzuki Motorcycle R-350 12
13
14
15
מדעים קשורים בלשנות למידת מכונה והסקה סטטיסטית פסיכולינגויסטיקה מדעי המחשב )AI( אלגוריתמים )חיפוש למשל( מדעי המוח Science( (Cognitive 17
שפה טבעית לעומת שפת מחשב שפות מחשב )באופן כללי( הנן חד-משמעיות ומוגדרות היטב. קומפילר יכול )ע"י )Parser לתרגם קוד לפקודות שפת מכונה. לדוגמא: יש הבחנה בין שווה במשמעות של (=) assignment לעומת (==).equality יש סדר מוגדר על פרדיקטים d או ולא גדול מ c b a a > b &&!c d a > b && (!c d) a > b &&!(c d) 18
ו ו או או )or( היינו דו משמעי בעברית )ואנגלית(: אתה יכול לקבל קפה או תה. (Exclusive) אתה רוצה קפה או עוגה? )Inclusive( עוד דוגמא: )טווח כמתים )quantifier scope "כמעט ניצחתי את כל שאר המתחרים בתחרות"( "באמת?" "כן: כמעט ניצחתי את ירון, כמעט ניצחתי את איריס, כמעט ניצחתי את אלון,..." 19
עברית קשה שפה לא רק עברית! השפה הטבעית מלאת רב משמעויות, ברמות שונות: כותרת תמונה בעיתון השבוע: "גופות הרוגים בפיגוע ליד בית חולים בבאלי היום." האם הפיגוע היה ליד בית חולים? מתי ארע הפיגוע? 20
רב משמעות תחבירית במשפט הבא 15 מילים ולפחות 455)!( ניתוחים תחביריים אפשריים: List the sales of the products produced in 1973 with the products produced in 1972. 22
Variability of Semantic Expression All major stock markets surged Dow ends up Dow climbs 255 Dow gains 255 points Stock market hits a record high The Dow Jones Industrial Average closed up 255 23
AI & Turing Test AI complete נחשב כ- NLP Turing Test: is a computer program intelligent? (1954) Would a human find out that he speaks with a computer? 24
רמות ידע לשוני פונטיקה ופונולוגיה מורפולוגיה תחביר )Syntax( סמנטיקה פרגמטיקה, שיח )Discourse( ידע כללי Knowledge( )World 25
Two dimensions of NLP Research Language analysis Applications 26
Deep into Deep Leraning In recent years, deep learning methods got tremendous momentum in AI This includes NLP Machine translation, parsing, summarization, Improved results in many areas, but not all Requires much training data Traditional NLP analysis often integrated We will touch on it in this course, mostly covered in Goldgerg s DL for texts and sequences 27
Course Material Highlights Part-of-speech tagging Syntactic chunking Named entity recognition Application: information extraction Syntactic parsing Semantic analysis Semantic parsing, learning semantic relationships, coreference resolution Semantic applications relation extraction 28